﻿//-----------------------------------------------------------------------
// <copyright file="IAgendaList.cs" company="tuliprules.org">
//     Copyright (c) 2010 tuplelister, tuliprules.org.
// </copyright>
// <summary>This is the IAgendaList interface.</summary>
//-----------------------------------------------------------------------

namespace Tulip.Engine.ConflictResolution
{
    using Tuples;

    /// <summary>
    /// Defines the contract for agenda lists.  Agenda lists implement a given approach
    /// to conflict resolution.  Each agenda list is ordered and can be considered to be
    /// a stack.
    /// </summary>
    public interface IAgendaList
    {
        /// <summary>
        /// Gets or sets the number of productions currently on the agenda.
        /// </summary>
        int Count { get; set; }

        /// <summary>
        /// Adds a production onto the agenda list.
        /// </summary>
        /// <param name="production">A production representing an activation of a rule.</param>
        void Push(Tuple production);

        /// <summary>
        /// Retrieves and removes a production from the top of the agenda list.
        /// </summary>
        /// <returns>A production representing an activation of a rule.</returns>
        Tuple Pop();

        /// <summary>
        /// Retrieves a production from the top of the agenda list.  the production is not 
        /// removed from the list.
        /// </summary>
        /// <returns>A production representing an activation of a rule.</returns>
        Tuple Peek();

        /// <summary>
        /// Locates and removes a given production from the agenda list.
        /// </summary>
        /// <param name="production">A production representing an activation of a rule.</param>
        void Remove(Tuple production);
    }
}
